package thread;

/**
 * Created with IntelliJ IDEA.
 * Description: wait()
 * User: 王圆豪
 * Date: 2025-04-27
 * Time: 23:50
 */
public class Demo23 {
    public static void main(String[] args) {
        Object locker = new Object();
        Thread thread = new Thread(()->{
           synchronized (locker) {

               try {
                   locker.wait();
               } catch (InterruptedException e) {
                   throw new RuntimeException(e);
               }

           }
        });

        thread.start();
    }
}
